package com.ruoyi.web.sso.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.web.sso.common.util.UuidUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.sso.mapper.PushDeviceInfoMapper;
import com.ruoyi.web.sso.domain.PushDeviceInfo;
import com.ruoyi.web.sso.service.IPushDeviceInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 设备信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-25
 */
@Service
public class PushDeviceInfoServiceImpl implements IPushDeviceInfoService 
{
    @Autowired
    private PushDeviceInfoMapper pushDeviceInfoMapper;

    /**
     * 查询设备信息
     * 
     * @param id 设备信息主键
     * @return 设备信息
     */
    @Override
    public PushDeviceInfo selectPushDeviceInfoById(String id)
    {
        return pushDeviceInfoMapper.selectPushDeviceInfoById(id);
    }

    /**
     * 查询设备信息列表
     * 
     * @param pushDeviceInfo 设备信息
     * @return 设备信息
     */
    @Override
    public List<PushDeviceInfo> selectPushDeviceInfoList(PushDeviceInfo pushDeviceInfo)
    {
        return pushDeviceInfoMapper.selectPushDeviceInfoList(pushDeviceInfo);
    }

    /**
     * 新增设备信息
     * 
     * @param pushDeviceInfo 设备信息
     * @return 结果
     */
    @Override
    public int insertPushDeviceInfo(PushDeviceInfo pushDeviceInfo)
    {
        pushDeviceInfo.setId(UuidUtil.getUuid());
        pushDeviceInfo.setCreateTime(DateUtils.getNowDate());
        return pushDeviceInfoMapper.insertPushDeviceInfo(pushDeviceInfo);
    }

    /**
     * 修改设备信息
     * 
     * @param pushDeviceInfo 设备信息
     * @return 结果
     */
    @Override
    public int updatePushDeviceInfo(PushDeviceInfo pushDeviceInfo)
    {
        pushDeviceInfo.setUpdateTime(DateUtils.getNowDate());
        return pushDeviceInfoMapper.updatePushDeviceInfo(pushDeviceInfo);
    }

    /**
     * 批量删除设备信息
     * 
     * @param ids 需要删除的设备信息主键
     * @return 结果
     */
    @Override
    public int deletePushDeviceInfoByIds(String ids)
    {
        return pushDeviceInfoMapper.deletePushDeviceInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除设备信息信息
     * 
     * @param id 设备信息主键
     * @return 结果
     */
    @Override
    public int deletePushDeviceInfoById(String id)
    {
        return pushDeviceInfoMapper.deletePushDeviceInfoById(id);
    }
}
